package com.ddn.controller.hall;

import com.ddn.service.hall.FeastService;
import com.ddn.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/*
  ❀❀❀---扎根---❀❀❀
    ❤ @libing ❤
  
*/
@RestController
@RequestMapping("/feast")
public class FeastController {

    @Autowired
    private FeastService feastService;

    /**
     * 查找全部的宴会厅信息
     * @param map
     * @return
     */
    @RequestMapping("/list")
    public ResultData feastList(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = feastService.findAllfeast(map);
        return resultData;
    }

    /**
     * 删除会客厅信息
     * @param map
     * @return
     */
    @RequestMapping("/delete")
    public ResultData feastDelete(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = feastService.deleteFeast(map);
        return resultData;
    }

    /**
     * 添加会客厅信息
     * @param map
     * @return
     */
    @RequestMapping("/add")
    public ResultData feastAdd(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = feastService.addFeast(map);
        return resultData;
    }

    /**
     * 更新宴会厅信息
     * @param map
     * @return
     */
    @RequestMapping("/update")
    public ResultData feastUpdate(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = feastService.updateFeast(map);
        return resultData;
    }

    /**
     * 批量删除房屋信息
     * @param ids
     * @return
     */
    @RequestMapping("/batch")
    public ResultData houseBatch(@RequestParam List<Integer> ids) {
        System.out.println(ids);
        ResultData resultData = feastService.batchFeast(ids);
        return resultData;
    }

}
